home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_203 / examples / yachtc3 / yahtzee.asm < prev    next >
Assembly Source File  |  1992-05-06  |  50KB  |  2,037 lines

  1. ;********************************************************************
  2. ;
  3. ;                                YachtC
  4. ;  Copyright 1985 by Sheldon Leemon.  Feel free to copy and distribute the
  5. ;  program and source code, but don't try to sell, license, or otherwise
  6. ;  commercially exploit it.
  7. ;
  8. ;  If you have questions or comments, you may contact the author through
  9. ;  Delphi (username = DRX) or Compuserve ID 72705,1355.  No late-night
  10. ;  phone calls, please.
  11. ;
  12. ;*********************************************************************
  13. ;
  14. ;Version 2.0  modifications by Mark Schretlen of Calgary,Alberta
  15. ;             86-03-16   ( some fixes & Steve Bennett's "scales"
  16. ;             incorporated with calls to Happy, Bomb, and YahtzeeSound).
  17. ;
  18. ;Version 3.0  further modifications by M. Schretlen for
  19. ;             multitasking "scales" 87-12-30.
  20. ;
  21. ;Version 4.0  Converted C to assembly code. Revamped audio portion of
  22. ;             program to use dissidents' custom music library. Jeff Glatt
  23.  
  24.                        SECTION YachtC4Code,CODE
  25.  
  26.    SMALLOBJ ;PC relative mode for CAPE assembler. If MANX, search for MANX
  27.             ;comments and make appropriate changes. Also eliminate this
  28.             ;PC relative directive. Please read "ManxPCBug" on this disc
  29.             ;because I've used a switch which Manx will probably assemble
  30.             ;incorrectly. Why not buy a real assembler instead of Manx Asm?
  31.  
  32.   ;MANX - uncomment these two lines
  33.   ;far code  ;Everyone else says "Small Data" if desired. Just like Manx to
  34.   ;far data  ;do it completely backwards.
  35.  
  36.    ;from amiga.lib or small.lib
  37.    XREF     _LVOOpenFont,_LVOCloseFont,_LVOSetFont
  38.    XREF     _LVOSetAPen,_LVOSetDrMd,_LVOPolyDraw,_LVOLoadRGB4
  39.    XREF     _LVOWait,_LVOGetMsg,_LVOReplyMsg,_LVOPutMsg
  40.    XREF     _LVOOpenWindow,_LVOCloseWindow,_LVOOpenScreen,_LVOCloseScreen
  41.    XREF     _LVOOpenLibrary,_LVOCloseLibrary
  42.    XREF     _LVORemoveGadget,_LVOAddGadget,_LVOOnGadget,_LVOOffGadget
  43.    XREF     _LVOAutoRequest,_LVOSetMenuStrip,_LVOViewPortAddress
  44.    XREF     _LVODraw,_LVOMove,_LVOText,_LVODrawImage
  45.    XREF     _LVOAllocMem,_LVOFreeMem
  46.    XREF     _LVOCurrentTime
  47.  
  48.    ;from SmallStart.asm
  49.    XREF     _SysBase,_DOSBase,_ThisTask,_exit
  50.  
  51.    ;from CHIP.asm
  52.    XREF     OneSpot,TwoSpot,ThreeSpot,FourSpot,FiveSpot,SixSpot
  53.  
  54.  ;  XREF     _do_sound,_init_sound
  55.  
  56. _do_sound:
  57. _init_sound rts
  58.  
  59.    XDEF   _main
  60. _main:
  61.     link     a5,#-358
  62.  ;---Open libs, screen, windows
  63.     bsr      open_libs
  64.     beq      Cleanup
  65.  ;---Initialize sound
  66.     jsr      _init_sound
  67.  ;---do_sound(YAHSOUND,7)
  68.     pea      7
  69.     pea      1
  70.     jsr      _do_sound
  71.     addq.l   #8,sp
  72.  ;---draw the score pad
  73.     bsr      draw_scorecard
  74. ;==================get number of players================
  75. ; while return value < 64, (wait until number of players selected from menu)
  76. .18 bsr      IMsg     ;returns 64,65,66,or 67 for players
  77.     moveq    #63,d1
  78.     sub.w    d1,d0
  79.     bls.s    .18
  80.     move.w   d0,d6    ;number of players (1-4)
  81. ;===============initialize the scores================
  82.     moveq    #4-1,d3      ;initialize 4 score cards
  83. ;for cats = 0 to < SCORECATS scores[players][cats++] = -1)
  84. ;==========blank the scoring columns to -1 to start with==========
  85. .22 moveq    #84,d0
  86.     mulu.w   d3,d0
  87.     lea      -350(a5),a0
  88.     adda.l   d0,a0
  89.     moveq    #20-1,d2     ;20 scores in this players score structure
  90.     moveq    #-1,d1
  91. .27 move.l   d1,(a0)+
  92.     Dbra     d2,.27
  93.   ;---Now re-initialize certain fields
  94.   ;---except for the rows with graphics or totals (they = 0)
  95.   ;---scores[players][6] = 0
  96.     lea      -326(a5),a0
  97.     clr.l    0(a0,d0.l)
  98.   ;---scores[players][7] = 0
  99.     lea      -322(a5),a0
  100.     clr.l    0(a0,d0.l)
  101.  ;---scores[players][8] = 0
  102.     lea      -318(a5),a0
  103.     clr.l    0(a0,d0.l)
  104.  ;---scores[players][9] = 0
  105.     lea      -314(a5),a0
  106.     clr.l    0(a0,d0.l)
  107.  ;---scores[players][17] = 0
  108.     lea      -282(a5),a0
  109.     clr.l    0(a0,d0.l)
  110.  ;---scores[players][18] = 0
  111.     lea      -278(a5),a0
  112.     clr.l    0(a0,d0.l)
  113.  ;---scores[players][19] = 0
  114.     lea      -274(a5),a0
  115.     clr.l    0(a0,d0.l)
  116.  ;---scores[players][20] = 0
  117.     lea      -270(a5),a0
  118.     clr.l    0(a0,d0.l)
  119.     Dbra     d3,.22
  120. ;=================draw the score pad================
  121.     bsr      draw_scorecard
  122. ;================Draw the 4 player Names=============
  123.   ;---Set DrawMode to JAM1
  124.     moveq    #0,d0
  125.     movea.l  RastPort,a1
  126.     movea.l  _GfxBase,a6
  127.     jsr      _LVOSetDrMd(a6)
  128.     moveq    #0,d2
  129. .30 bsr      Name
  130.     addq.b   #1,d2
  131.     cmp.w    d6,d2
  132.     bcs.s    .30
  133. ;========================play a whole game==============
  134.  ;======for turns = 1 to 13 (score slots on a Yachtze Card)
  135.     moveq    #13-1,d7
  136.   ;=======for cur_player = 1 to #ofplayers
  137. .34 moveq    #0,d2
  138.     lea      -350(a5),a3    ;scores[player0]
  139.    ;---highlight the player's name
  140. .38 moveq    #5,d0          ;JAM2+INVERSVID
  141.     movea.l  RastPort,a1
  142.     jsr      _LVOSetDrMd(a6)
  143.     bsr      Name
  144.    ;---get dice values
  145.     lea      -2(a5),a4      ;bones structure + 10 [start is -12(a5)]
  146.     bsr      roll_dice
  147.    ;---do_sound(DICEROLL,4)
  148.     pea      4
  149.     pea      4
  150.     jsr      _do_sound
  151.     addq.w   #8,sp
  152.    ;---score_turn(scores[cur_player],bones,cur_player)
  153.     lea      -12(a5),a0
  154.     bsr      score_turn
  155.    ;---unhighlight the player's name
  156.     moveq    #1,d0          ;JAM2
  157.     movea.l  RastPort,a1
  158.     movea.l  _GfxBase,a6
  159.     jsr      _LVOSetDrMd(a6)
  160.     bsr      Name
  161.    ;---next player
  162.     moveq    #84,d0
  163.     adda.l   d0,a3     ;next player's scores structure
  164.     addq.b   #1,d2
  165.     cmp.w    d6,d2
  166.     bcs.s    .38
  167.    ;---one score slot complete
  168.     Dbra     d7,.34
  169.     bra      .18       ;go back for next game, or quit
  170.  
  171. ;================== "BONES" STRUCTURE ========================
  172. ;   12 byte structure holding current dice values and # of rolls
  173. ;bones dc.w  die1value    ;0(BASE) value of die #1
  174. ;      dc.w  die2value    ;2
  175. ;      dc.w  die3value    ;4
  176. ;      dc.w  die4value    ;6
  177. ;      dc.w  die5value    ;8
  178. ;      dc.w  #ofRolls     ;10  total rolls/turns (3 max)
  179. ;
  180. ; This routine rolls all 5 dice (via Rollrep), waits for user to select and
  181. ; change dice for 3 turns/rolls (via IMsg and Shake), and returns the bones
  182. ; structure with final, filled-in values.
  183. ;
  184. ; roll_dice(bones+10)
  185. ;              a4
  186.  
  187.    XDEF   roll_dice
  188. roll_dice:
  189.     movem.l  d2/a2/a3,-(sp)
  190.     movea.l  _IntuitionBase,a6
  191.     lea      DieGadg5,a3     ;start with last die's gadget
  192.     moveq    #5-1,d2         ;last die number
  193.  ;---bones[#ofRolls] = 1
  194.     moveq    #1,d0
  195.     move.w   d0,(a4)
  196.  ;---this die's Gadget Activation = TOGGLESELECT
  197. .45 Bset.b   #0,14(a3)
  198.  ;---roll all 5 dice and store results (i.e. the 1st turn/roll)
  199.     bsr      Rollrep
  200.     move.w   d0,-(a4)
  201.     moveq    #44,d1
  202.     suba.l   d1,a3
  203.     Dbra     d2,.45
  204.  ;---Turn on the "ROLL" gadget
  205.     suba.l   a2,a2
  206.     movea.l  ScoreWindow,a1
  207.     lea      RollGadget,a0
  208.     jsr      _LVOOnGadget(a6)
  209. ;============while changed=1 AND bones[TURNS] < 3 ==================
  210.   ;while flag < 17 OR flag > 24  (wait til "ROLL" gadget selected)
  211. .49 bsr      IMsg
  212.     cmp.w    #17,d0
  213.     bcs.s    .49
  214.     cmp.w    #24,d0
  215.     bhi.s    .49         ;branch back if not ROLL gadget
  216.   ;----shake whichever die is selected
  217.     movea.l  _IntuitionBase,a6
  218.     bsr      Shake       ;returns # of dice selected for change
  219.     move.b   d0,d1
  220.     beq.s    .48         ;exit if none changed
  221.     moveq    #3,d0
  222.     sub.w    10(a4),d0
  223.     bhi.s    .49         ;branch if not 3 rolls yet (turn = 0,1,or 2)
  224.   ;----Turn "ROLL" Gadget off
  225. .48 movea.l  ScoreWindow,a1
  226.     lea      RollGadget,a0
  227.     jsr      _LVOOffGadget(a6)
  228.  ;---Disable all 5 dice gadgets
  229.     moveq    #5-1,d1
  230.     lea      DieGadg1+14,a0
  231.     moveq    #44,d0
  232. .54 clr.w    (a0)        ;this die's Gadget Activation = NULL
  233.     adda.l   d0,a0
  234.     Dbra     d1,.54
  235. ;=============CHECK FOR YAHTZEE (all 5 die equal)==============
  236. ;if all 5 bones values are equal, then do_sound(YAHSOUND,5)
  237.     move.w   (a4)+,d0
  238.     cmp.w    (a4)+,d0
  239.     bne.s    .56
  240.     cmp.w    (a4)+,d0
  241.     bne.s    .56
  242.     cmp.w    (a4)+,d0
  243.     bne.s    .56
  244.     sub.w    (a4)+,d0
  245.     bne.s    .56
  246.     pea      5
  247.     pea      1
  248.     jsr      _do_sound
  249.     addq.l   #8,sp
  250. .56 movem.l  (sp)+,d2/a2/a3
  251.     rts
  252.  
  253. ;**************************************************************
  254. ; This routine evaluates the current dice values in the bones array
  255. ; in terms of the score they produce for the scoring category (passed
  256. ; as row for the function "Evaluate" which returns the score).
  257. ;
  258. ;score_turn(scores,bones,cur_player)
  259. ;             a3    a0      d2
  260.  
  261.    XDEF   score_turn
  262. score_turn:
  263.     link     a5,#-22
  264.     movem.l  d3/a2,-(sp)
  265.  ;-----Zero out temporary sort array
  266.     moveq    #7-1,d0
  267.     lea      -20(a5),a2 ;values[0]
  268.     movea.l  a2,a1
  269. .62 clr.w    (a2)+
  270.     Dbra     d0,.62
  271. ;============for 5 die (sort dice by number of spots)===========
  272.     moveq    #5-1,d0
  273.     lea      12(a1),a2  ;values[6]
  274. .66 move.w   (a0)+,d1   ;bones[die#]
  275.   ;---add (1+bones[die#]) to value[6]  /* add die to total */
  276.     add.w    d1,(a2)    ;total of all 5 die
  277.     addq.w   #1,(a2)
  278.   ;---add 1 to values[bones[die#]]
  279.     add.w    d1,d1
  280.     addq.w   #1,0(a1,d1.w)
  281.     Dbra     d0,.66
  282. ;===============position score gadget==================
  283. ;ScoreGadget.LeftEdge = VLINL + (VLINS*cur_player) + 4
  284.     moveq    #90,d0
  285.     mulu.w   d2,d0
  286.     addi.w   #132,d0
  287.     move.w   d0,_ScoreGadget+4
  288. ;==============show possible scores to let player select===============
  289.     moveq    #17-1,d3   ;do 17 rows
  290.     lea      68(a3),a2  ;past row #16
  291.  ;----if scores[row] = -1, then no score there yet
  292. .70 move.l   -(a2),d0
  293.     bpl.s    .72
  294.  ;----erase dots with bg pen
  295.     moveq    #0,d0
  296.     movea.l  RastPort,a1
  297.     movea.l  _GfxBase,a6
  298.     jsr      _LVOSetAPen(a6)
  299.     ;---ShowDots (row,cur_player)
  300.     move.w   d2,d0
  301.     move.w   d3,d1
  302.     bsr      ShowDots
  303.  ;---show possible scores in purple
  304.     moveq    #PURP,d0
  305.     movea.l  RastPort,a1
  306.     jsr      _LVOSetAPen(a6)
  307.     ;---score = Evaluate(values,row)
  308.     lea      -20(a5),a0
  309.     bsr      Evaluate
  310.    ;---ShowScore (score,row,cur_player)
  311.     move.l   d2,-(sp)
  312.     move.l   d3,-(sp)
  313.     move.l   d0,-(sp)
  314.     bsr      _ShowScore
  315.     lea      12(sp),sp
  316. .72 Dbra     d3,.70
  317. ;====wait  until user clicks on a score of an unused category=======
  318. ;   while row > 17 OR scores[row] is not = -1 (already scored slot)
  319. .73 bsr      IMsg
  320.     moveq    #17,d1
  321.     sub.w    d0,d1
  322.     bcs.s    .73
  323.     move.w   d0,d3           ;row # (0 to 17)
  324.     add.b    d0,d0
  325.     add.w    d0,d0
  326.     move.l   0(a2,d0.w),d1
  327.     bpl.s    .73             ;branch back if already scored
  328.   ;----selected score in forest green
  329.     moveq    #FGRP,d0
  330.     movea.l  RastPort,a1
  331.     movea.l  _GfxBase,a6
  332.     jsr      _LVOSetAPen(a6)
  333.   ;---score = Evaluate(values,row)   /* evaluate row selected */
  334.     lea      -20(a5),a0
  335.     bsr      Evaluate
  336.     move.w   d0,-2(a5)
  337.   ;---ShowScore (score,row,cur_player), and save score in score structure
  338.     move.l   d2,-(sp)
  339.     move.w   d3,d1
  340.     move.l   d3,-(sp)
  341.     add.b    d1,d1
  342.     add.w    d1,d1
  343.     move.l   d0,0(a2,d1.w)   ;store score in the this row's field
  344.     move.l   d0,-(sp)
  345.     bsr      _ShowScore
  346.     lea      12(sp),sp
  347. ;**************Steve Bennett's "scales" sounds.**************
  348. ;if score < 3 OR (score < 6 AND row > 2)  do_sound(BOMBSOUND,5)
  349.     move.w   -2(a5),d0
  350.     cmp.b    #3,d0
  351.     bcs.s    .77
  352.     cmp.b    #6,d0
  353.     bcc.s    .76
  354.     cmp.w    #2,d3
  355.     bls.s    .76
  356. .77 pea      5
  357.     pea      3
  358.     jsr      _do_sound
  359.     addq.w   #8,sp
  360.     bra      .78
  361. ;else if (score > 18 AND row < 6) OR (score > 25 AND row > 8)
  362. ;do_sound(HAPPYSOUND,5)
  363. .76 cmpi.b   #18,d0
  364.     bls.s    .81
  365.     cmp.w    #6,d3
  366.     bcs.s    .80
  367. .81 cmpi.b   #25,d0
  368.     bls.s    .79
  369.     cmp.w    #8,d3
  370.     bls.s    .79
  371. .80 pea      5
  372.     pea      2
  373.     jsr      _do_sound
  374.     addq.w   #8,sp
  375.     bra.s    .78
  376. ;else if (score < 20 AND row > 8)  do_sound(HAPPYSOUND,1)
  377. .79 cmpi.b   #20,d0
  378.     bcc.s    .78
  379.     cmp.w    #8,d3
  380.     bhi.s    .80
  381. ;=================if row < 7====================
  382. .78 moveq    #7,d1
  383.     sub.w    d1,d3
  384.     bcc.s    .84
  385.   ;---ClearRow(7,cur_player)
  386.     move.w   d2,d0
  387.     ;        #7,d1
  388.     bsr      ClearRow
  389.   ;ShowScore (scores[7],7,cur_player)   /* do upper sub-total
  390.     move.l   d2,-(sp)
  391.     pea      7
  392.     move.w   -2(a5),d0
  393.     add.w    d0,30(a3)     ;add score to scores[7]
  394.     move.l   28(a3),-(sp)
  395.     bsr      _ShowScore
  396.     lea      12(sp),sp
  397.     bra.s    .85
  398.   ;----ClearRow(18,cur_player)
  399. .84 move.w   d2,d0
  400.     moveq    #18,d1
  401.     bsr      ClearRow
  402.   ;ShowScore (scores[18],18,cur_player)   /* or else lower total
  403.     move.l   d2,-(sp)
  404.     pea      18
  405.     move.w   -2(a5),d0
  406.     add.w    d0,74(a3)     ;add score to scores[18]
  407.     move.l   72(a3),-(sp)
  408.     bsr      _ShowScore
  409.     lea      12(sp),sp
  410. ;if scores[7] > BONUS
  411. .85 moveq    #63,d0
  412.     sub.l    28(a3),d0
  413.     bhi.s    .86
  414.   ;---ClearRow(8,cur_player)
  415.     move.w   d2,d0
  416.     moveq    #8,d1
  417.     bsr      ClearRow
  418.   ;ShowScore (scores[8] = 35, 8, cur_player)   /* check for bonus
  419.     move.l   d2,-(sp)
  420.     pea      8
  421.     moveq    #35,d0
  422.     move.l   d0,32(a3)
  423.     move.l   d0,-(sp)
  424.     bsr      _ShowScore
  425.     lea      12(sp),sp
  426. ;==============add sub-totals to total and display=============
  427.   ;---ClearRow(20,cur_player)
  428. .86 move.w   d2,d0
  429.     moveq    #20,d1
  430.     bsr      ClearRow
  431.   ;ShowScore (scores[20]=scores[7]+scores[8]+scores[18],20,cur_player)
  432.     move.l   d2,-(sp)
  433.     pea      20
  434.     move.l   28(a3),d0
  435.     add.l    32(a3),d0
  436.     add.l    72(a3),d0
  437.     move.l   d0,80(a3)
  438.     move.l   d0,-(sp)
  439.     bsr      _ShowScore
  440.     lea      12(sp),sp
  441. ;============================= Do 17 Rows =============================
  442.     moveq    #17-1,d3
  443.     lea      68(a3),a2  ;past row #16
  444. ;----Check if this row is unscored still
  445. .89 move.l   -(a2),d0
  446.     bpl.s    .91
  447. ;------erase the score of this row with bg pen
  448.     moveq    #0,d0
  449.     movea.l  RastPort,a1
  450.     movea.l  _GfxBase,a6
  451.     jsr      _LVOSetAPen(a6)
  452.   ;---score = Evaluate(values,row
  453.     lea      -20(a5),a0
  454.     bsr      Evaluate
  455.   ;---ShowScore (score,row,cur_player)
  456.     move.l   d2,-(sp)
  457.     move.l   d3,-(sp)
  458.     move.l   d0,-(sp)
  459.     bsr      _ShowScore
  460.     lea      12(sp),sp
  461. ;==========draw dots in black pen===============
  462.     moveq    #7,d0
  463.     movea.l  RastPort,a1
  464.     movea.l  _GfxBase,a6
  465.     jsr      _LVOSetAPen(a6)
  466.    ;----ShowDots (row,cur_player)
  467.     move.w   d2,d0
  468.     move.w   d3,d1
  469.     bsr      ShowDots
  470. ;------------Next row------------
  471. .91 Dbra     d3,.89
  472.     movem.l  (sp)+,d3/a2
  473.     unlk     a5
  474.     rts
  475.  
  476. ;********************************************************************
  477. ; Handles IntuiEvents of MENUPICK, GADGETUP, and CLOSEWINDOW. If CLOSEWINDOW,
  478. ; exits immediately. If GADGETUP, returns 0 to 17 for row in scorecard.
  479. ; Returns between 17 to 24 for ROLL gadg. Otherwise, default return = 35.
  480. ; If MENUPICK, returns 64 + # of players if MENU #0 selected, 32 if MENU #1
  481. ; selected.
  482.  
  483.    XDEF   IMsg
  484. IMsg:
  485.      movem.l  d2-d4/a2,-(sp)
  486.  ;---Initially, flag = 35
  487.      moveq    #35,d2
  488.  ;----Wait for Score window message, then get it
  489.      movea.l  ScoreWindow,a0
  490.      movea.l  86(a0),a2
  491.      move.b   15(a2),d1
  492.      moveq    #0,d0
  493.      Bset.l   d1,d0
  494.      movea.l  _SysBase,a6
  495.      jsr      _LVOWait(a6)
  496. .95  movea.l  a2,a0
  497.      jsr      _LVOGetMsg(a6)
  498.      move.l   d0,d1
  499.      bne.s    .96
  500.   ;---return flag
  501.      move.w   d2,d0
  502.      movem.l  (sp)+,d2-d4/a2
  503.      rts
  504. .96  movea.l  d0,a1
  505.      lea      20(a1),a0
  506.      move.l   (a0)+,-(sp)
  507.      move.w   (a0)+,d3         ;CODE
  508.      addq.l   #8,a0
  509.      move.w   (a0)+,d4         ;MOUSEY
  510.      jsr      _LVOReplyMsg(a6)
  511.      move.l   (sp)+,d0         ;CLASS
  512.      Btst.l   #6,d0
  513.      bne.s    .100
  514.      Btst.l   #8,d0
  515.      bne.s    .101
  516.      Btst.l   #9,d0
  517.      beq.s    .95
  518. ;===============case CLOSEWINDOW:==================
  519. .99  movem.l  (sp)+,d2-d4/a2
  520.      bra      Cleanup
  521. ;===============case GADGETUP:=====================
  522.  ;---flag (i.e. row #) = (MOUSEY-29)/8
  523. .100 move.w   d4,d2
  524.      moveq    #29,d1
  525.      sub.w    d1,d2
  526.      lsr.w    #3,d2
  527.      bra.s    .95
  528. ;==============case MENUPICK:====================
  529. .101 move.w   d3,d1
  530.      andi.w   #$1F,d3
  531.      beq      .104
  532.      subq.w   #1,d3
  533.      bne.s    .95
  534.    ;=============MENU 1:
  535. .105 lsr.w    #5,d1
  536.      andi.w   #$3F,d1
  537.      beq.s   .108
  538.    ;----------ITEM 1:
  539.    ; Show the about requester
  540. .109 move.w   #148,d3
  541.      lea      _AboutText+200,a1
  542. .PP  movem.l  a2/a3/a6,-(sp)
  543.      move.w   #515,d2
  544.      moveq    #0,d0
  545.      moveq    #0,d1
  546.      movea.l  ScoreWindow,a0
  547.      lea      _OKText,a3
  548.      suba.l   a2,a2
  549.      movea.l  _IntuitionBase,a6
  550.      jsr      _LVOAutoRequest(a6)
  551.      movem.l  (sp)+,a2/a3/a6
  552.    ;---flag = 32
  553.      moveq    #32,d2
  554.      bra      .95
  555.   ;--------ITEM 0:
  556.   ; Show the Instructions requester
  557. .108 move.w   #180,d3
  558.      lea      _InstructText+260,a1
  559.      bra.s    .PP
  560. ;==============MENU 0:
  561.   ;-----flag (i.e. number of players + 64) = 64 + ITEMNUM
  562. .104 lsr.w    #5,d1
  563.      andi.w   #$3F,d1
  564.      moveq    #64,d2
  565.      add.b    d1,d2
  566.      bra      .95
  567.  
  568. ;==================================================================
  569. ;changed = Shake(bones, IntuitionBase)
  570. ;                 a4         a6
  571.  
  572.    XDEF   Shake
  573. Shake:
  574.      movem.l  d2/d3/a2/a3,-(sp)
  575.      moveq    #0,d3        ;initially, changed = 0
  576.      moveq    #5-1,d2      ;# of die
  577.      lea      DieGadg5,a3  ;start with last die
  578.      suba.l   a2,a2        ;for OnGadget
  579.   ;---Turn on this die
  580. .115 movea.l  ScoreWindow,a1
  581.      movea.l  a3,a0
  582.      jsr      _LVOOnGadget(a6)
  583.   ;If this die's Flags = SELECTED, then roll die and store result
  584.      Btst.b   #7,13(a3)
  585.      beq.s    .113
  586.      bsr.s    Rollrep
  587.      move.l   d2,d1
  588.      add.b    d1,d1
  589.      move.w   d0,0(a4,d1.l)
  590. ;=============Deselect the die Gadget==============
  591. ;Since its not nice to change the SELECTED flag while the gadget is active
  592. ;(only the user is supposed to do that by clicking on it), we'll be nice
  593. ;and first Remove the die gadget from the list, THEN change the flag
  594. ;and finally, Add it back to the list again.
  595.    ;---RemoveGadget(BdWdw, &DieGadg[die#])
  596.      movea.l  a3,a1
  597.      movea.l  ScoreWindow,a0
  598.      jsr      _LVORemoveGadget(a6)
  599.   ;---toggle SELECTED flag
  600.      Bchg.b   #7,13(a3)
  601.   ;---AddGadget(BdWdw,&DieGadg[die#],Gadget#)
  602.      movea.l  a3,a1
  603.      movea.l  ScoreWindow,a0
  604.      jsr      _LVOAddGadget(a6)
  605.      addq.b   #1,d3
  606. .113 moveq    #44,d0
  607.      suba.l   d0,a3      ;next die Gadget
  608.      Dbra     d2,.115
  609.   ;----increment bones[TURNS] (another roll finished)
  610.      addq.w   #1,10(a4)
  611.   ;---return total number of changed (selected) dice
  612.      move.w   d3,d0
  613.      movem.l  (sp)+,d2/d3/a2/a3
  614.      rts
  615.  
  616. ;==================================================================
  617. ;throw = Rollrep(die_number, DieGadgAddr, Intuitionbase)
  618. ;                   d2           a3            a6
  619.  
  620.    XDEF   Rollrep
  621. Rollrep:
  622.      move.l   d3,-(sp)
  623.      move.l   d4,-(sp)
  624.      moveq    #9-1,d3     ;do 9 random throws before final value returned
  625.   ;----throw = random()%6
  626. roll bsr.s    random
  627.      moveq    #6,d1
  628.      divu     d1,d0
  629.      swap     d0
  630.      move.w   d0,d4
  631.   ;---Blank out the Die face
  632.      moveq    #31,d1      ;BLANKS
  633.      mulu.w   d2,d1
  634.      moveq    #20,d0      ;BLANKT
  635.      add.w    d0,d1       ;TopOffset = (BLANKS*Die#)+BLANKIT
  636.      move.w   #530,d0     ;LeftOffset = BLANKL
  637.      lea      BlankImage,a1
  638.      movea.l  RastPort,a0
  639.      movem.l  d0/d1/a0,-(sp)
  640.      jsr      _LVODrawImage(a6)
  641. ;---Draw the die Image that was thrown and store address in die's Gadget-
  642. ;   Render field for subsequent updates
  643.      moveq    #20,d0
  644.      mulu.w   d4,d0
  645.      lea      Die1Image,a1
  646.      adda.l   d0,a1          ;The image struct of this die
  647.      move.l   a1,18(a3)      ;store in die's GadgetRender field
  648.      movem.l  (sp)+,d0/d1/a0
  649.      jsr      _LVODrawImage(a6)
  650.      Dbra     d3,roll
  651.    ;---return(throw)
  652.      move.w   d4,d0
  653.      move.l   (sp)+,d4
  654.      move.l   (sp)+,d3
  655.      rts
  656.  
  657.   XDEF random,RAND
  658. random:
  659.  ;----RAND = RAND * 1103515245 + 12345
  660.    move.l   #1103515245,d1
  661.    move.l   RAND,d0
  662.    bsr.s    multiply
  663.    addi.l   #12345,d0
  664.    move.l   d0,RAND
  665.  ;-----return (RAND/65536) % 32768
  666.    clr.w    d0
  667.    swap     d0        ;divide by 65536
  668.    Bclr.l   #15,d0
  669.    rts
  670.  
  671.    XDEF multiply
  672.  ;This routine multiplies 2 numbers passed in d0 and d1.
  673.  ;d0 x d1 = d0  (unsigned)
  674. multiply movea.l d2,a0   ;save d2 and d3
  675.          movea.l d3,a1
  676.        move.l  d0,d2
  677.        move.l  d1,d3
  678.        swap    d2
  679.        swap    d3
  680.        mulu    d1,d2
  681.        mulu    d0,d3
  682.        mulu    d1,d0
  683.        add.w   d3,d2
  684.        swap    d2
  685.        clr.w   d2
  686.        add.l   d2,d0
  687.          move.l  a1,d3   ;restore d2 and d3
  688.          move.l  a0,d2
  689.        rts
  690.  
  691. RAND dc.l 1
  692.  
  693. ;==================================================================
  694. ;score = Evaluate (values,row)
  695. ;                    a0   d3
  696. evl  dc.w     .zr-evl2
  697.      dc.w     .zr-evl2
  698.      dc.w     .zr-evl2
  699.      dc.w     .140-evl2
  700.      dc.w     .148-evl2
  701.      dc.w     .156-evl2
  702.      dc.w     .164-evl2
  703.      dc.w     .176-evl2
  704.      dc.w     .199-evl2
  705.      dc.w     .205-evl2
  706.  
  707.    XDEF   Evaluate
  708. Evaluate:
  709.      move.l   d2,-(sp)
  710.   ;--------switch(row)
  711.      move.l   d3,d1
  712.      subq.l   #7,d1
  713.      bls.s    .0to5
  714.      moveq    #10,d0
  715.      cmp.l    d0,d1
  716.      bcc.s    .zr
  717.      add.b    d1,d1
  718.      move.w   evl(pc,d1.w),d1
  719. evl2 jmp      evl2(pc,d1.w)
  720. ;=================case 0: through case 5:=====================
  721.   ;----return (row+1)*values[row]  (return total of desired spots)
  722. .0to5:
  723.      move.w   d3,d0
  724.      move.l   d3,d1
  725.      addq.b   #1,d0
  726.      add.b    d1,d1
  727.      adda.l   d1,a0
  728.      mulu.w   (a0),d0
  729.      bra.s    .139
  730. ;===============case 10: 3 of a kind===============
  731. .140 moveq    #2,d1
  732.      bra.s    KD
  733. ;===============case 11: 4 of a kind===============
  734. .148 moveq    #3,d1
  735. KD   moveq    #0,d0
  736.   ;----if values[count] > 3, return values[6] (total of dice) instead of 0
  737.      moveq    #6-1,d2
  738.      lea      12(a0),a1
  739. .151 cmp.w    (a0)+,d1
  740.      bcc.s    .149
  741.      move.w   (a1),d0
  742. .149 Dbra     d2,.151
  743.      bra.s    .139
  744. ;==============case 12: full house=============
  745. .156 moveq    #0,d1
  746.   ;---if values[count] > 1, flagg = flagg + values[count]
  747.      moveq    #6-1,d2
  748.      moveq    #1,d0
  749. .159 cmp.w    (a0)+,d0
  750.      bcc.s    .158
  751.      add.w    -2(a0),d1
  752. .158 Dbra     d2,.159
  753.  ;---If flagg = 5, return 25. Otherwise 0.
  754.      moveq    #0,d0
  755.      subq.b   #5,d1
  756.      bne.s    .139
  757.      moveq    #25,d0
  758. .139 move.l   (sp)+,d2
  759.      rts
  760. ;============case 13: small straight============
  761. .164 moveq    #3-1,d1    ;do 3 checks
  762. SRT  movea.l  a0,a1
  763.      moveq    #4-1,d2    ;check for 4 numbers in order
  764.   ;---Is there 1 (or more) of this #?
  765. AGN  move.w   (a1)+,d0
  766.      Dbeq     d2,AGN     ;fall through if no occurences of this #
  767.      bne.s    strt       ;must be a straight of 4 numbers
  768.   ;---Try next 4 numbers
  769.      addq.l   #2,a0
  770.      Dbra     d1,SRT
  771.      bra.s    .zr
  772. strt moveq    #30,d0
  773.      bra.s    .139
  774. ;==============case 14: large straight===============
  775. .176 moveq    #2-1,d1    ;do 2 checks
  776. SRt  movea.l  a0,a1
  777.      moveq    #5-1,d2    ;check for 5 numbers in order
  778.   ;---Is there 1 (or more) of this #?
  779. AGn  move.w   (a1)+,d0
  780.      Dbeq     d2,AGn     ;fall through if no occurences of this #
  781.      bne.s    strT       ;must be a straight of 4 numbers
  782.   ;---Try next 4 numbers
  783.      addq.l   #2,a0
  784.      Dbra     d1,SRt
  785. .zr  moveq    #0,d0
  786.      bra.s    .139
  787. strT moveq    #40,d0
  788.      bra.s    .139
  789. ;================case 15: Yachtze==============
  790.   ;---if values[count] = 5, then return 50
  791. .199 moveq    #6-1,d2   ;do 6 die
  792.      moveq    #0,d0
  793.      moveq    #5,d1     ;check for 5 of this die
  794. .202 cmp.w    (a0)+,d1
  795.      Dbeq     d2,.202
  796.      bne      .139
  797.      moveq    #50,d0
  798.      bra      .139
  799. ;=============case 16: Chance============
  800.    ;----return values[6]
  801. .205 moveq    #0,d0
  802.      move.w   12(a0),d0
  803.      bra      .139
  804.  
  805. ;==================================================================
  806. ;ShowScore(score,row,player)
  807.  
  808.    XDEF   _ShowScore
  809. _ShowScore:
  810.    movem.l  d2/a2,-(sp)
  811.    movea.l  _GfxBase,a6
  812.  ;---SetDrMd to JAM1
  813.    moveq    #0,d0
  814.    movea.l  RastPort,a1
  815.    movea.l  a1,a2
  816.    jsr      _LVOSetDrMd(a6)
  817.  ;---Move (BdRp,DOTL + (DOTS*player), (row*TEXTS)+DOTT )
  818.    move.w   18(sp),d1
  819.    lsl.w    #3,d1
  820.    moveq    #36,d2
  821.    add.w    d2,d1
  822.    move.w   22(sp),d0
  823.    mulu.w   #90,d0
  824.    move.b   #155,d2
  825.    add.w    d2,d0
  826.    movea.l  a2,a1
  827.    jsr      _LVOMove(a6)
  828.  ;---Text (BdRp, "    ",4)
  829.    moveq    #4,d0
  830.    lea      Spaces,a0
  831.    movea.l  a2,a1
  832.    jsr      _LVOText(a6)
  833.  ;---format_4(score_str,score)
  834.    move.l   12(sp),d0
  835.    lea      Zeros,a0
  836.    bsr.s    format_4
  837. ;Move (BdRp,DOTL + (DOTS*player + ((4-length)*SPACEW) ), (row*TEXTS)+DOTT )
  838.    move.w   22(sp),d0
  839.    mulu.w   #90,d0
  840.    add.w    #155,d0   ;x
  841.   ;---
  842.    move.w   18(sp),d1
  843.    lsl.w    #3,d1
  844.    moveq    #36,d2
  845.    add.w    d2,d1        ;y
  846.    movea.l  a2,a1
  847.    jsr      _LVOMove(a6)
  848.  ;---Text (BdRp, score_str, length)
  849.    moveq    #4,d0
  850.    lea      Zeros,a0
  851.    movea.l  a2,a1
  852.    movem.l  (sp)+,d2/a2
  853.    jmp      _LVOText(a6)
  854.  
  855. ;===================================================================
  856. ; An sprintf for positive hex to decimal ascii string, 4 digit field. Blanks
  857. ; are filled for leading zeros, and buffer padded out to 4 chars.
  858. ;
  859. ;            format_4(value, Buffer)
  860. ;                      d0      a0
  861.  
  862. Conversion dc.w  1000,100,10,1
  863.  
  864.    XDEF   format_4
  865. format_4:
  866.      movem.l d2-d4,-(sp)
  867.      moveq   #0,d4       ;leading zero flag
  868. ;---Convert the value to Decimal
  869.      moveq   #4-1,d2     ;do 4 digits
  870.      lea     Conversion,a1
  871. g07  moveq   #0,d1       ;where to store the converted digit
  872.      move.w  (a1)+,d3    ;the next conversion factor
  873. ;---Convert a digit field (for example, the 10s digit)
  874. Rep1 cmp.w   d3,d0
  875.      bcs.s   g011
  876.      addq.b  #1,d1
  877.      sub.l   d3,d0
  878.      bra.s   Rep1
  879. ;---Check whether we have a leading digit of zero. If so, move
  880. ;---on to the next field unless this IS the last field in
  881. ;---which case we have to store a 0. If this digit is
  882. ;---not a zero, then print it.
  883. g011 move.b  d1,d3  ;test for 0 digit
  884.      beq.s   g012
  885.      moveq   #1,d4  ;indicate non-zero digit (only set once)
  886. g012 move.b  d4,d3
  887.      bne.s   g013
  888.      move.w  d2,d3
  889.      beq.s   g013   ;branch if the 1's digit AND value is zero
  890.      moveq   #' ',d1
  891.      bra.s   SF
  892. ;---Convert to Ascii and store this digit
  893. g013 addi.b  #'0',d1
  894. SF   move.b  d1,(a0)+
  895. g014 Dbra    d2,g07     ;next digit calculation
  896.      clr.b   (a0)
  897.      movem.l (sp)+,d2-d4
  898.      rts
  899.  
  900. ;=================================================================
  901. ;ShowDots (row,player)
  902. ;           d1   d0
  903.  
  904.    XDEF   ShowDots
  905. ShowDots:
  906.  ;----Move (BdRp,DOTL + (DOTS*player), (row*TEXTS)+DOTT )
  907.    move.l   d2,-(sp)
  908.    lsl.w    #3,d1
  909.    moveq    #36,d2
  910.    add.w    d2,d1
  911.    moveq    #90,d2
  912.    mulu.w   d2,d0
  913.    move.b   #155,d2
  914.    add.w    d2,d0
  915.    movea.l  RastPort,a1
  916.    move.l   (sp),d2
  917.    move.l   a1,(sp)
  918.    movea.l  _GfxBase,a6
  919.    jsr      _LVOMove(a6)
  920.  ;---SetDrMd to JAM1
  921.    moveq    #0,d0
  922.    movea.l  (sp),a1
  923.    jsr      _LVOSetDrMd(a6)
  924.  ;---Print out '....'
  925.    moveq    #4,d0
  926.    lea      Dots,a0
  927.    movea.l  (sp)+,a1
  928.    jmp      _LVOText(a6)
  929.  
  930. Dots  dc.b   '....',0
  931. Zeros dc.b   '0000',0
  932.  
  933. ;======================================================================
  934. ;ClearRow (row,player)
  935. ;           d1   d0
  936.  
  937.    XDEF   ClearRow
  938. ClearRow:
  939.  ;----Move (BdRp,DOTL + (DOTS*player), (row*TEXTS)+DOTT )
  940.    move.l   d2,-(sp)
  941.    lsl.w    #3,d1
  942.    moveq    #36,d2
  943.    add.w    d2,d1
  944.    moveq    #90,d2
  945.    mulu.w   d2,d0
  946.    move.b   #155,d2
  947.    add.w    d2,d0
  948.    movea.l  RastPort,a1
  949.    move.l   (sp),d2
  950.    move.l   a1,(sp)
  951.    movea.l  _GfxBase,a6
  952.    jsr      _LVOMove(a6)
  953.  ;---SetDrMd to JAM2
  954.    moveq    #1,d0
  955.    movea.l  (sp),a1
  956.    jsr      _LVOSetDrMd(a6)
  957.  ;---Output "    "
  958.    moveq    #4,d0
  959.    lea      Spaces,a0
  960.    movea.l  (sp)+,a1
  961.    jmp      _LVOText(a6)
  962.  
  963. ;====================================================================
  964. ;Name (player, _GfxBase)
  965. ;        d2       a6
  966.  
  967.    XDEF   Name
  968. Name:
  969.  ;---Move(BdRp, DOTL -(2*SPACEW) + (DOTS*player), TEXTT+2)
  970.    moveq    #90,d0
  971.    mulu.w   d2,d0
  972.    moveq    #0,d1
  973.    move.b   #135,d1
  974.    add.w    d1,d0
  975.    moveq    #22,d1
  976.    movea.l  RastPort,a1
  977.    move.l   a1,-(sp)
  978.    jsr      _LVOMove(a6)
  979.  ;---Text(BdRp, textline[MAXLINES+player], 8)
  980.    movea.l  (sp)+,a1
  981.    moveq    #8,d0
  982.    moveq    #23,d1    ;MAXLINES
  983.    add.w    d2,d1
  984.    add.w    d1,d1
  985.    add.w    d1,d1
  986.    lea      _textline,a0
  987.    adda.w   d1,a0
  988.    movea.l  (a0),a0
  989.    jmp      _LVOText(a6)
  990.  
  991. ;===================================================================
  992. ;  Open intuition, graphics libs, font, windows, screen, set menu
  993. ;  returns d0 = 1 if successful, 0 if something failed.
  994.  
  995. LIB_VERSION equ 33
  996.  
  997.                 XDEF  open_libs
  998. open_libs:
  999. ;======Open The Intuition Library=======
  1000. B0  moveq    #LIB_VERSION,d0
  1001.     lea      IntuitionName,a1
  1002.     movea.l  _SysBase,a6
  1003.     jsr      _LVOOpenLibrary(a6)
  1004.     move.l   d0,_IntuitionBase
  1005.     beq      B10
  1006. ;======Open The Graphics Library========
  1007. B1  moveq    #LIB_VERSION,d0
  1008.     lea      GfxName,a1
  1009.     jsr      _LVOOpenLibrary(a6)
  1010.     move.l   d0,_GfxBase
  1011.     beq      B10
  1012. ;========Open the Topaz 8 Font==========
  1013. B4  lea      TextAttr,a0
  1014.     movea.l  _GfxBase,a6
  1015.     jsr      _LVOOpenFont(a6)
  1016.     move.l   d0,FontPtr
  1017.     beq      B10
  1018. ;==========Open Custom Screen===========
  1019. B5  lea      NewScreen,a0
  1020.     movea.l  _IntuitionBase,a6
  1021.     jsr      _LVOOpenScreen(a6)
  1022.     move.l   d0,Screen
  1023.     beq      B10
  1024.     lea      NewWindow,a0
  1025.     move.l   d0,30(a0)
  1026. ;=========Open the main window==========
  1027.     jsr      _LVOOpenWindow(a6)
  1028.     move.l   d0,ScoreWindow
  1029.     beq      B10
  1030. ;====Get Pointer to Window's RastPort=====
  1031. B6  movea.l  d0,a0
  1032.     movea.l  50(a0),a1
  1033.     move.l   a1,RastPort         ;the address our this window's rastport.
  1034. ;====Set the Font for this window to Topaz 8====
  1035. B7  movea.l  FontPtr,a0
  1036.     movea.l  _GfxBase,a6
  1037.     jsr      _LVOSetFont(a6)
  1038. ;====Attach our menus to the window======
  1039. B8  lea      _BdMenu,a1
  1040.     movea.l  ScoreWindow,a0
  1041.     movea.l  _IntuitionBase,a6
  1042.     jsr      _LVOSetMenuStrip(a6)
  1043. ;====Get the Front Window's ViewPort==========
  1044.     movea.l  ScoreWindow,a0
  1045.     jsr      _LVOViewPortAddress(a6)
  1046.     move.l   d0,_WVPort
  1047. ;=======load our new set of (8) colors======
  1048.     movea.l  d0,a0
  1049.     moveq    #8,d0
  1050.     lea      _colormap,a1
  1051.     movea.l  _GfxBase,a6
  1052.     jsr      _LVOLoadRGB4(a6)
  1053. ;====Indicate that everything worked=====
  1054.     moveq    #1,d0               ;If we got here, indicate success by d0 = 1.
  1055. B10 rts
  1056.  
  1057.    XDEF   draw_scorecard
  1058. draw_scorecard:
  1059.      link     a5,#-8
  1060.      movem.l  d2/d3/a2/a3/a4,-(sp)
  1061. ;====================Set up the board outline===========================
  1062.   ;--SetAPen to BLKP
  1063.      moveq    #7,d0
  1064.      movea.l  RastPort,a1
  1065.      movea.l  a1,a2
  1066.      movea.l  _GfxBase,a6
  1067.      jsr      _LVOSetAPen(a6)
  1068.   ;--Move to (0,VLINT)
  1069.      moveq    #13,d1      ;VLINT
  1070.      moveq    #0,d0
  1071.      movea.l  a2,a1
  1072.      jsr      _LVOMove(a6)
  1073.   ;---SetDrMd = JAM2
  1074.      moveq    #1,d0
  1075.      movea.l  a2,a1
  1076.      jsr      _LVOSetDrMd(a6)
  1077.   ;---PolyDraw  8 boardlines points
  1078.      lea      _boardlines,a0
  1079.      moveq    #8,d0
  1080.      movea.l  a2,a1
  1081.      jsr      _LVOPolyDraw(a6)
  1082. ;==============Put in text and horizontal lines for board===========
  1083.   ;---Move to (TEXTL,TEXTT+2)
  1084.      moveq    #22,d1
  1085.      moveq    #5,d0
  1086.      movea.l  a2,a1
  1087.      jsr      _LVOMove(a6)
  1088.   ;---Print out "players"
  1089.      lea      _textline,a3
  1090.      movea.l  (a3)+,a0
  1091.      movea.l  a0,a1
  1092. len  move.b   (a1)+,d0
  1093.      bne.s    len
  1094.      subq.l   #1,a1
  1095.      move.l   a1,d0
  1096.      sub.l    a0,d0
  1097.      movea.l  a2,a1
  1098.      jsr      _LVOText(a6)
  1099. ;===========for count = 1 to < MAXLINES==================
  1100.      moveq    #1,d0
  1101.      move.w   d0,-8(a5)
  1102.      moveq    #28,d2       ;Y position = (line# * TEXTS) + TEXTT
  1103.   ;---if the textline string = ' ' then draw a line
  1104. .238 movea.l  (a3)+,a4
  1105.      move.b   (a4),d0
  1106.      bne.s    .239
  1107.   ;----Move to (1,[count*HLINS+HLINT])
  1108.      move.w   d2,d1
  1109.      subq.w   #2,d1
  1110.      moveq    #1,d0
  1111.      movea.l  a2,a1
  1112.      jsr      _LVOMove(a6)
  1113.   ;-----Draw to (HLINR,[count*HLINS+HLINT])
  1114.      move.w   d2,d1
  1115.      subq.w   #2,d1
  1116.      move.w   #489,d0
  1117.      movea.l  a2,a1
  1118.      jsr      _LVODraw(a6)
  1119.      bra.s    .236
  1120. ;=======else, print the text and do columns=============
  1121.    ;---Move(BdRp,TEXTL,(count*TEXTS)+TEXTT)
  1122. .239 move.w   d2,d1
  1123.      moveq    #5,d0
  1124.      movea.l  a2,a1
  1125.      jsr      _LVOMove(a6)
  1126.   ;---Text(BdRp,textline[count],strlen(textline[count]))
  1127.      movea.l  a4,a0
  1128. leN  move.b   (a4)+,d0
  1129.      bne.s    leN
  1130.      subq.l   #1,a4
  1131.      move.l   a4,d0
  1132.      sub.l    a0,d0
  1133.      movea.l  a2,a1
  1134.      jsr      _LVOText(a6)
  1135.    ;=========for column = 0 to < MAXPLAYERS
  1136.      moveq    #4-1,d3
  1137.   ;----ClearRow(count-2,column)
  1138. .243 move.w    d3,d0
  1139.      move.w    -8(a5),d1
  1140.      subq.w    #2,d1
  1141.      bsr       ClearRow
  1142.   ;---ShowDots(count-2,column)
  1143.      move.w    d3,d0
  1144.      move.w    -8(a5),d1
  1145.      subq.w    #2,d1
  1146.      bsr       ShowDots
  1147.      Dbra      d3,.243
  1148. .236 addq.w    #8,d2
  1149.      addq.w    #1,-8(a5)
  1150.      cmp.w     #23,-8(a5)
  1151.      bcs.s     .238
  1152. ;==================Draw vertical lines for board==================
  1153. ;   for count = 0 to < MAXPLAYERS    should replace this with DrawBorder
  1154.      moveq    #4-1,d3
  1155.      moveq    #127,d2
  1156.      addq.b   #2,d2     ;VLINL+1
  1157.   ;----Move(BdRp,(count*VLINS)+VLINL+1,VLINT)
  1158. .246 move.w   d2,d0
  1159.      moveq    #13,d1    ;VLINT
  1160.      movea.l  a2,a1
  1161.      jsr      _LVOMove(a6)
  1162.   ;---Draw(BdRp,(count*VLINS)+VLINL+1,VLINB)
  1163.      moveq    #0,d1
  1164.      move.b   #199,d1
  1165.      move.w   d2,d0
  1166.      movea.l  a2,a1
  1167.      jsr      _LVODraw(a6)
  1168.   ;---Move(BdRp,(count*VLINS)+VLINL,VLINT)
  1169.      moveq    #13,d1
  1170.      subq.w   #1,d2
  1171.      move.w   d2,d0
  1172.      movea.l  a2,a1
  1173.      jsr      _LVOMove(a6)
  1174.   ;---Draw(BdRp,(count*VLINS)+VLINL,VLINB)
  1175.      move.w   d2,d0
  1176.      moveq    #0,d1
  1177.      move.b   #199,d1
  1178.      movea.l  a2,a1
  1179.      jsr      _LVODraw(a6)
  1180.      moveq    #91,d1      ;VLINS+1
  1181.      add.w    d1,d2       ;next line y position
  1182.      Dbra     d3,.246
  1183. ;=======================Blank players names======================
  1184.    ;---SetDrMd = JAM2
  1185.      moveq    #1,d0
  1186.      movea.l  a2,a1
  1187.      jsr      _LVOSetDrMd(a6)
  1188.      moveq    #4-1,d3
  1189.      move.w   #135,d2
  1190.   ;---Move(BdRp, DOTL - (2*SPACEW) + (DOTS*count), TEXTT+2)
  1191. .249 moveq    #22,d1
  1192.      move.w   d2,d0
  1193.      movea.l  a2,a1
  1194.      jsr      _LVOMove(a6)
  1195.   ;---Output 8 spaces
  1196.      moveq    #8,d0
  1197.      lea      Spaces,a0
  1198.      movea.l  a2,a1
  1199.      jsr      _LVOText(a6)
  1200.      moveq    #90,d1
  1201.      add.w    d1,d2
  1202.      Dbra     d3,.249
  1203. ;================Set initial 5 die images to Sixes=======================
  1204.      moveq    #5-1,d3
  1205.      moveq    #20,d2    ;BLANKT
  1206.      movea.l  _IntuitionBase,a6
  1207.    ;DrawImage (BdRp, &Blank, BLANKL, (BLANKS*count) + BLANKT)
  1208. .252 move.w   d2,d1
  1209.      move.w   #530,d0
  1210.      lea      BlankImage,a1
  1211.      movea.l  a2,a0
  1212.      movem.l  d0/d1/a0,-(sp)
  1213.      jsr      _LVODrawImage(a6)
  1214.   ;DrawImage (BdRp, &DieImage[5], BLANKL, (BLANKS*count) + BLANKT)
  1215.      movem.l  (sp)+,d0/d1/a0
  1216.      lea      Die6Image,a1
  1217.      jsr      _LVODrawImage(a6)
  1218.      moveq    #31,d1    ;BLANKS
  1219.      add.w    d1,d2
  1220.      Dbra     d3,.252
  1221. ;================use time to seed random number generator============
  1222.    ;---CurrentTime(&Seconds,&Micros)
  1223.      lea      -8(a5),a1
  1224.      lea      -4(a5),a0
  1225.      jsr      _LVOCurrentTime(a6)
  1226.    ;---seed random generator with Micros
  1227.      move.l   -8(a5),RAND
  1228.      movem.l  (sp)+,d2/d3/a2/a3/a4
  1229.      unlk     a5
  1230.      rts
  1231.  
  1232.    XDEF   Cleanup
  1233. Cleanup:
  1234.   ;----do_sound(NULL,0)
  1235.     clr.l   -(sp)
  1236.     clr.l   -(sp)
  1237.     jsr      _do_sound
  1238.     addq.l   #8,sp
  1239.   ;---Close BdWdw window
  1240. noM movea.l  _IntuitionBase,a6
  1241.     move.l   ScoreWindow,d0
  1242.     beq.s    noW
  1243.     movea.l  d0,a0
  1244.     jsr      _LVOCloseWindow(a6)
  1245.   ;---Close BdScr screen
  1246. noW move.l   Screen,d0
  1247.     beq.s    NoS
  1248.     movea.l  d0,a0
  1249.     jsr      _LVOCloseScreen(a6)
  1250.   ;---Close Graphics and Intuition Libraries
  1251. NoS movea.l  _SysBase,a6
  1252.     move.l   _GfxBase,d0
  1253.     beq.s    noG
  1254.     movea.l  d0,a1
  1255.     jsr      _LVOCloseLibrary(a6)
  1256. noG move.l   _IntuitionBase,d0
  1257.     beq.s    noI
  1258.     movea.l  d0,a1
  1259.     jsr      _LVOCloseLibrary(a6)
  1260. noI clr.l    -(sp)
  1261.     jsr      _exit
  1262.  
  1263.   ;MANX need this section directive
  1264.   ;   SECTION  YahtzeeData,DATA
  1265.  
  1266.    XDEF     _GfxBase,_IntuitionBase,Screen,ScoreWindow,_BackWdw,_WVPort
  1267. _IntuitionBase dc.l 0
  1268. _GfxBase       dc.l 0
  1269. Screen         dc.l 0
  1270. FontPtr        dc.l 0
  1271. ScoreWindow    dc.l 0
  1272. RastPort       dc.l 0
  1273. _BackWdw       dc.l 0
  1274. _WVPort        dc.l 0
  1275.  
  1276. ;=========================== NEWSCREEN STRUCTURE =========================
  1277.    XDEF   NewScreen
  1278. NewScreen:
  1279.    dc.w   0,0,640,200 ;LEFTEDGE,TOPEDGE,WIDTH,HEIGHT
  1280.    dc.w   3
  1281.    dc.b   5,2
  1282.    dc.w   $8000
  1283.    dc.w   15
  1284.    dc.l   TextAttr
  1285.    dc.l   $0000
  1286.    dc.l   $0000
  1287.    dc.l   $0000
  1288.  
  1289. ;============================ NEWWINDOW STRUCTURES =======================
  1290.    XDEF   NewWindow
  1291. NewWindow:
  1292.    dc.w   0,0,640,200
  1293.    dc.b   6,3
  1294.  ;---IDCMPFlags = CLOSEWINDOW | GADGETUP | MENUPICK
  1295.    dc.l   $0340
  1296.    dc.l   $180c
  1297.    dc.l   _ScoreGadget
  1298.    dc.l   $0000
  1299.    dc.l   NBTitle
  1300.    dc.l   $0000
  1301.    dc.l   $0000
  1302.    dc.w   0,0,0,0
  1303.    dc.w   15
  1304.  
  1305. ;=========================== BORDER FOR SCORECARD =========================
  1306. HLINR equ 489
  1307. VLINT equ 13
  1308. VLINB equ 199
  1309. HLINL equ 1
  1310.  
  1311.    XDEF   _boardlines
  1312. _boardlines:  dc.w  HLINR,VLINT,HLINR,VLINB,HLINL-1,VLINB,HLINL-1,VLINT
  1313.               dc.w  HLINL,VLINT,HLINL,VLINB,HLINR-1,VLINB,HLINR-1,VLINT
  1314.  
  1315. ;======================== PEN COLORS (COLORMAP) =====================
  1316. BGRP equ 0
  1317. REDP equ 1
  1318. GRNP equ 2
  1319. YELP equ 3
  1320. FGRP equ 4
  1321. PURP equ 5
  1322. BLUP equ 6
  1323. BLKP equ 7
  1324.  
  1325.    XDEF  _colormap
  1326. _colormap:
  1327.    dc.w   $FFF   ;WHITE  (background color)
  1328.    dc.w   $F00   ;RED    (color of window-close box)
  1329.    dc.w   $0F0   ;GREEN  (color of menu title)
  1330.    dc.w   $FF0   ;YELLOW (color of window-close dot)
  1331.    dc.w   $0B1   ;FOREST GREEN (scores)
  1332.    dc.w   $91F   ;PURPLE (color of possible scores)
  1333.    dc.w   $00F   ;BLUE
  1334.    dc.w   $000   ;BLACK
  1335.  
  1336. ;==================== TEXT ATTRIBUTE STRUCTURE (Topaz 9) =================
  1337.    XDEF   TextAttr
  1338. TextAttr:
  1339.    dc.l   FontName
  1340.    dc.w   9
  1341.    dc.b   0
  1342.    dc.b   1
  1343.  
  1344. ;================== IMAGE STRUCTURE FOR BLANKING DIE ================
  1345.    XDEF   BlankImage
  1346. BlankImage:
  1347.    dc.w   0,0,56,23
  1348.    dc.w   1
  1349.    dc.l   $0000
  1350.    dc.b   0,1
  1351.    dc.l   $0000
  1352.  
  1353. ;================= IMAGE STRUCTURES FOR 6 FACES OF A DIE ==================
  1354.    XDEF   Die1Image,Die2Image,Die3Image,Die4Image,Die5Image,Die6Image
  1355. Die1Image:
  1356.    dc.w   4,2,48,19
  1357.    dc.w   1
  1358.    dc.l   OneSpot
  1359.    dc.b   2,1
  1360.    dc.l   $0000
  1361.  
  1362. Die2Image:
  1363.    dc.w   4,2,48,19
  1364.    dc.w   1
  1365.    dc.l   TwoSpot
  1366.    dc.b   2,1
  1367.    dc.l   $0000
  1368.  
  1369. Die3Image:
  1370.    dc.w   4,2,48,19
  1371.    dc.w   1
  1372.    dc.l   ThreeSpot
  1373.    dc.b   2,1
  1374.    dc.l   $0000
  1375.  
  1376. Die4Image:
  1377.    dc.w   4,2,48,19
  1378.    dc.w   1
  1379.    dc.l   FourSpot
  1380.    dc.b   2,1
  1381.    dc.l   $0000
  1382.  
  1383. Die5Image:
  1384.    dc.w   4,2,48,19
  1385.    dc.w   1
  1386.    dc.l   FiveSpot
  1387.    dc.b   2,1
  1388.    dc.l   $0000
  1389.  
  1390. Die6Image:
  1391.    dc.w   4,2,48,19
  1392.    dc.w   1
  1393.    dc.l   SixSpot
  1394.    dc.b   2,1
  1395.    dc.l   $0000
  1396.  
  1397. ;================== GADGET STRUCTURES FOR 5 DICE ==================
  1398.    XDEF   DieGadg1
  1399. DieGadg1:
  1400.    dc.l   DieGadg2
  1401.    dc.w   530,20,56,23
  1402.    dc.w   6          ;Flags = GADGIMAGE | GADGHIMAGE
  1403.    dc.w   0          ;Activation is initially none. Only enabled when rolled
  1404.    dc.w   1          ;BOOLGADGET type
  1405.    dc.l   Die6Image  ;Selected Image is changed depending on die roll
  1406.    dc.l   BlankImage ;DeSelected Image is always Blank
  1407.    dc.l   $0000
  1408.    dc.l   $0000
  1409.    dc.l   $0000
  1410.    dc.w   1
  1411.    dc.l   0
  1412.  
  1413. DieGadg2:
  1414.    dc.l   DieGadg3
  1415.    dc.w   530,51,56,23
  1416.    dc.w   6
  1417.    dc.w   0
  1418.    dc.w   1
  1419.    dc.l   Die6Image
  1420.    dc.l   BlankImage
  1421.    dc.l   $0000
  1422.    dc.l   $0000
  1423.    dc.l   $0000
  1424.    dc.w   2
  1425.    dc.l   $0000
  1426.  
  1427. DieGadg3:
  1428.    dc.l   DieGadg4
  1429.    dc.w   530,82,56,23
  1430.    dc.w   6
  1431.    dc.w   0
  1432.    dc.w   1
  1433.    dc.l   Die6Image
  1434.    dc.l   BlankImage
  1435.    dc.l   $0000
  1436.    dc.l   $0000
  1437.    dc.l   $0000
  1438.    dc.w   3
  1439.    dc.l   $0000
  1440.  
  1441. DieGadg4:
  1442.    dc.l   DieGadg5
  1443.    dc.w   530,113,56,23
  1444.    dc.w   6
  1445.    dc.w   0
  1446.    dc.w   1
  1447.    dc.l   Die6Image
  1448.    dc.l   BlankImage
  1449.    dc.l   $0000
  1450.    dc.l   $0000
  1451.    dc.l   $0000
  1452.    dc.w   4
  1453.    dc.l   $0000
  1454.  
  1455. DieGadg5:
  1456.    dc.l   0
  1457.    dc.w   530,144,56,23
  1458.    dc.w   6
  1459.    dc.w   0
  1460.    dc.w   1
  1461.    dc.l   Die6Image
  1462.    dc.l   BlankImage
  1463.    dc.l   $0000
  1464.    dc.l   $0000
  1465.    dc.l   $0000
  1466.    dc.w   5
  1467.    dc.l   $0000
  1468.  
  1469.    XDEF   _RollText
  1470. _RollText:
  1471.    dc.b   2
  1472.    dc.b   1
  1473.    dc.b   1
  1474.    dc.b   0
  1475.    dc.w   0
  1476.    dc.w   7
  1477.    dc.l   TextAttr
  1478.    dc.l   ROLL
  1479.    dc.l   $0000
  1480.  
  1481. ROLL dc.b ' ROLL',0
  1482.  
  1483.    XDEF   RollGadget
  1484. RollGadget:
  1485.    dc.l   DieGadg1
  1486.    dc.w   530,175,56,23
  1487.    dc.w   260
  1488.    dc.w   1
  1489.    dc.w   1
  1490.    dc.l   BlankImage
  1491.    dc.l   $0000
  1492.    dc.l   _RollText
  1493.    dc.l   $0000
  1494.    dc.l   $0000
  1495.    dc.w   6
  1496.    dc.l   0
  1497.  
  1498.    XDEF   _ScoreGadget
  1499. _ScoreGadget:
  1500.    dc.l   RollGadget
  1501.    dc.w   132,29,84,136
  1502.    dc.w   3
  1503.    dc.w   1
  1504.    dc.w   1
  1505.    dc.l   $0000
  1506.    dc.l   $0000
  1507.    dc.l   $0000
  1508.    dc.l   $0000
  1509.    dc.l   $0000
  1510.    dc.w   7
  1511.    dc.l   0
  1512.  
  1513.    XDEF   _AboutText
  1514. _AboutText:
  1515.    dc.b   6
  1516.    dc.b   0
  1517.    dc.b   1
  1518.    dc.b   0
  1519.    dc.w   20
  1520.    dc.w   9
  1521.    dc.l   TextAttr
  1522.    dc.l   .4+0
  1523.    dc.l   $0000
  1524.  
  1525.    dc.b   6
  1526.    dc.b   0
  1527.    dc.b   1
  1528.    dc.b   0
  1529.    dc.w   20
  1530.    dc.w   18
  1531.    dc.l   TextAttr
  1532.    dc.l   .4+46
  1533.    dc.l   _AboutText
  1534.  
  1535.    dc.b   6
  1536.    dc.b   0
  1537.    dc.b   1
  1538.    dc.b   0
  1539.    dc.w   20
  1540.    dc.w   27
  1541.    dc.l   TextAttr
  1542.    dc.l   .4+92
  1543.    dc.l   _AboutText+20
  1544.  
  1545.    dc.b   6
  1546.    dc.b   0
  1547.    dc.b   1
  1548.    dc.b   0
  1549.    dc.w   20
  1550.    dc.w   36
  1551.    dc.l   TextAttr
  1552.    dc.l   .4+138
  1553.    dc.l   _AboutText+40
  1554.  
  1555.    dc.b   6
  1556.    dc.b   0
  1557.    dc.b   1
  1558.    dc.b   0
  1559.    dc.w   20
  1560.    dc.w   45
  1561.    dc.l   TextAttr
  1562.    dc.l   .4+184
  1563.    dc.l   _AboutText+60
  1564.  
  1565.    dc.b   6
  1566.    dc.b   0
  1567.    dc.b   1
  1568.    dc.b   0
  1569.    dc.w   20
  1570.    dc.w   54
  1571.    dc.l   TextAttr
  1572.    dc.l   .4+230
  1573.    dc.l   _AboutText+80
  1574.  
  1575.    dc.b   6
  1576.    dc.b   0
  1577.    dc.b   1
  1578.    dc.b   0
  1579.    dc.w   20
  1580.    dc.w   63
  1581.    dc.l   TextAttr
  1582.    dc.l   .4+276
  1583.    dc.l   _AboutText+100
  1584.  
  1585.    dc.b   6
  1586.    dc.b   0
  1587.    dc.b   1
  1588.    dc.b   0
  1589.    dc.w   20
  1590.    dc.w   72
  1591.    dc.l   TextAttr
  1592.    dc.l   .4+322
  1593.    dc.l   _AboutText+120
  1594.  
  1595.    dc.b   6
  1596.    dc.b   0
  1597.    dc.b   1
  1598.    dc.b   0
  1599.    dc.w   20
  1600.    dc.w   81
  1601.    dc.l   TextAttr
  1602.    dc.l   .4+368
  1603.    dc.l   _AboutText+140
  1604.  
  1605.    dc.b   6
  1606.    dc.b   0
  1607.    dc.b   1
  1608.    dc.b   0
  1609.    dc.w   20
  1610.    dc.w   90
  1611.    dc.l   TextAttr
  1612.    dc.l   .4+414
  1613.    dc.l   _AboutText+160
  1614.  
  1615.    dc.b   6
  1616.    dc.b   0
  1617.    dc.b   1
  1618.    dc.b   0
  1619.    dc.w   20
  1620.    dc.w   98
  1621.    dc.l   TextAttr
  1622.    dc.l   .4+460
  1623.    dc.l   _AboutText+180
  1624.  
  1625. ;=========================== TEXT ============================
  1626.    XDEF  _textline
  1627. _textline:
  1628.    dc.l   SC1
  1629.    dc.l   SC2
  1630.    dc.l   SC3
  1631.    dc.l   SC4
  1632.    dc.l   SC5
  1633.    dc.l   SC6
  1634.    dc.l   SC7
  1635.    dc.l   SC8
  1636.    dc.l   SC9
  1637.    dc.l   SC10
  1638.    dc.l   SC11
  1639.    dc.l   SC12
  1640.    dc.l   SC13
  1641.    dc.l   SC14
  1642.    dc.l   SC15
  1643.    dc.l   SC16
  1644.    dc.l   SC17
  1645.    dc.l   SC18
  1646.    dc.l   SC19
  1647.    dc.l   SC20
  1648.    dc.l   SC21
  1649.    dc.l   SC22
  1650.    dc.l   SC23
  1651.    dc.l   SC24
  1652.    dc.l   SC25
  1653.    dc.l   SC26
  1654.    dc.l   SC27
  1655.  
  1656.    XDEF   _InstructText
  1657. _InstructText:
  1658.    dc.b   6
  1659.    dc.b   0
  1660.    dc.b   1
  1661.    dc.b   0
  1662.    dc.w   16
  1663.    dc.w   9
  1664.    dc.l   TextAttr
  1665.    dc.l   .5+0
  1666.    dc.l   $0000
  1667.  
  1668.    dc.b   6
  1669.    dc.b   0
  1670.    dc.b   1
  1671.    dc.b   0
  1672.    dc.w   16
  1673.    dc.w   18
  1674.    dc.l   TextAttr
  1675.    dc.l   .5+47
  1676.    dc.l   _InstructText
  1677.  
  1678.    dc.b   6
  1679.    dc.b   0
  1680.    dc.b   1
  1681.    dc.b   0
  1682.    dc.w   16
  1683.    dc.w   27
  1684.    dc.l   TextAttr
  1685.    dc.l   .5+94
  1686.    dc.l   _InstructText+20
  1687.  
  1688.    dc.b   6
  1689.    dc.b   0
  1690.    dc.b   1
  1691.    dc.b   0
  1692.    dc.w   16
  1693.    dc.w   36
  1694.    dc.l   TextAttr
  1695.    dc.l   .5+141
  1696.    dc.l   _InstructText+40
  1697.  
  1698.    dc.b   6
  1699.    dc.b   0
  1700.    dc.b   1
  1701.    dc.b   0
  1702.    dc.w   16
  1703.    dc.w   45
  1704.    dc.l   TextAttr
  1705.    dc.l   .5+188
  1706.    dc.l   _InstructText+60
  1707.  
  1708.    dc.b   6
  1709.    dc.b   0
  1710.    dc.b   1
  1711.    dc.b   0
  1712.    dc.w   16
  1713.    dc.w   54
  1714.    dc.l   TextAttr
  1715.    dc.l   .5+235
  1716.    dc.l   _InstructText+80
  1717.  
  1718.    dc.b   6
  1719.    dc.b   0
  1720.    dc.b   1
  1721.    dc.b   0
  1722.    dc.w   16
  1723.    dc.w   63
  1724.    dc.l   TextAttr
  1725.    dc.l   .5+282
  1726.    dc.l   _InstructText+100
  1727.  
  1728.    dc.b   6
  1729.    dc.b   0
  1730.    dc.b   1
  1731.    dc.b   0
  1732.    dc.w   16
  1733.    dc.w   72
  1734.    dc.l   TextAttr
  1735.    dc.l   .5+329
  1736.    dc.l   _InstructText+120
  1737.  
  1738.    dc.b   6
  1739.    dc.b   0
  1740.    dc.b   1
  1741.    dc.b   0
  1742.    dc.w   16
  1743.    dc.w   81
  1744.    dc.l   TextAttr
  1745.    dc.l   .5+376
  1746.    dc.l   _InstructText+140
  1747.  
  1748.    dc.b   6
  1749.    dc.b   0
  1750.    dc.b   1
  1751.    dc.b   0
  1752.    dc.w   16
  1753.    dc.w   90
  1754.    dc.l   TextAttr
  1755.    dc.l   .5+423
  1756.    dc.l   _InstructText+160
  1757.  
  1758.    dc.b   6
  1759.    dc.b   0
  1760.    dc.b   1
  1761.    dc.b   0
  1762.    dc.w   16
  1763.    dc.w   99
  1764.    dc.l   TextAttr
  1765.    dc.l   .5+470
  1766.    dc.l   _InstructText+180
  1767.  
  1768.    dc.b   6
  1769.    dc.b   0
  1770.    dc.b   1
  1771.    dc.b   0
  1772.    dc.w   16
  1773.    dc.w   108
  1774.    dc.l   TextAttr
  1775.    dc.l   .5+517
  1776.    dc.l   _InstructText+200
  1777.  
  1778.    dc.b   6
  1779.    dc.b   0
  1780.    dc.b   1
  1781.    dc.b   0
  1782.    dc.w   16
  1783.    dc.w   117
  1784.    dc.l   TextAttr
  1785.    dc.l   .5+564
  1786.    dc.l   _InstructText+220
  1787.  
  1788.    dc.b   6
  1789.    dc.b   0
  1790.    dc.b   1
  1791.    dc.b   0
  1792.    dc.w   16
  1793.    dc.w   126
  1794.    dc.l   TextAttr
  1795.    dc.l   .5+611
  1796.    dc.l   _InstructText+240
  1797.  
  1798.    XDEF   _OKText
  1799. _OKText:
  1800.    dc.b   6
  1801.    dc.b   0
  1802.    dc.b   1
  1803.    dc.b   0
  1804.    dc.w   6
  1805.    dc.w   3
  1806.    dc.l   TextAttr
  1807.    dc.l   .6
  1808.    dc.l   $0000
  1809.  
  1810. .6 dc.b   32,80,114,111,99,101,101,100,32,0
  1811.  
  1812.    XDEF   _Menu0IText
  1813. _Menu0IText:
  1814.    dc.b   6
  1815.    dc.b   0
  1816.    dc.b   1
  1817.    dc.b   0
  1818.    dc.w   0
  1819.    dc.w   0
  1820.    dc.l   TextAttr
  1821.    dc.l   .7+0
  1822.    dc.l   $0000
  1823.  
  1824.    dc.b   6
  1825.    dc.b   0
  1826.    dc.b   1
  1827.    dc.b   0
  1828.    dc.w   0
  1829.    dc.w   0
  1830.    dc.l   TextAttr
  1831.    dc.l   .7+22
  1832.    dc.l   $0000
  1833.  
  1834.    dc.b   6
  1835.    dc.b   0
  1836.    dc.b   1
  1837.    dc.b   0
  1838.    dc.w   0
  1839.    dc.w   0
  1840.    dc.l   TextAttr
  1841.    dc.l   .7+44
  1842.    dc.l   $0000
  1843.  
  1844.    dc.b   6
  1845.    dc.b   0
  1846.    dc.b   1
  1847.    dc.b   0
  1848.    dc.w   0
  1849.    dc.w   0
  1850.    dc.l   TextAttr
  1851.    dc.l   .7+66
  1852.    dc.l   $0000
  1853.  
  1854.    XDEF   _Menu1IText
  1855. _Menu1IText:
  1856.    dc.b   6
  1857.    dc.b   0
  1858.    dc.b   1
  1859.    dc.b   0
  1860.    dc.w   0
  1861.    dc.w   0
  1862.    dc.l   TextAttr
  1863.    dc.l   INSTR
  1864.    dc.l   $0000
  1865.  
  1866.    dc.b   6
  1867.    dc.b   0
  1868.    dc.b   1
  1869.    dc.b   0
  1870.    dc.w   0
  1871.    dc.w   0
  1872.    dc.l   TextAttr
  1873.    dc.l   ABOUT
  1874.    dc.l   $0000
  1875.  
  1876.    XDEF   _Menu0Item
  1877. _Menu0Item:
  1878.    dc.l   _Menu0Item+34
  1879.    dc.w   0,0,210,9
  1880.    dc.w   82
  1881.    dc.l   $0000
  1882.    dc.l   _Menu0IText
  1883.    dc.l   $0000
  1884.    dc.b   0,0
  1885.    dc.l   $0000
  1886.    dc.w   -1
  1887.  
  1888.    dc.l   _Menu0Item+68
  1889.    dc.w   0,9,210,9
  1890.    dc.w   82
  1891.    dc.l   $0000
  1892.    dc.l   _Menu0IText+20
  1893.    dc.l   $0000
  1894.    dc.b   0,0
  1895.    dc.l   $0000
  1896.    dc.w   -1
  1897.  
  1898.    dc.l   _Menu0Item+102
  1899.    dc.w   0,18,210,9
  1900.    dc.w   82
  1901.    dc.l   $0000
  1902.    dc.l   _Menu0IText+40
  1903.    dc.l   $0000
  1904.    dc.b   0,0
  1905.    dc.l   $0000
  1906.    dc.w   -1
  1907.  
  1908.    dc.l   $0000
  1909.    dc.w   0,27,210,9
  1910.    dc.w   82
  1911.    dc.l   $0000
  1912.    dc.l   _Menu0IText+60
  1913.    dc.l   $0000
  1914.    dc.b   0,0
  1915.    dc.l   $0000
  1916.    dc.w   -1
  1917.  
  1918.    XDEF   _Menu1Item
  1919. _Menu1Item:
  1920.    dc.l   _Menu1Item+34
  1921.    dc.w   0,0,140,9
  1922.    dc.w   82
  1923.    dc.l   $0000
  1924.    dc.l   _Menu1IText
  1925.    dc.l   $0000
  1926.    dc.b   0,0
  1927.    dc.l   $0000
  1928.    dc.w   -1
  1929.  
  1930.    dc.l   $0000
  1931.    dc.w   0,9,140,9
  1932.    dc.w   82
  1933.    dc.l   $0000
  1934.    dc.l   _Menu1IText+20
  1935.    dc.l   $0000
  1936.    dc.b   0,0
  1937.    dc.l   $0000
  1938.    dc.w   -1
  1939.  
  1940.    XDEF   _BdMenu
  1941. _BdMenu:
  1942.    dc.l   _BdMenu+30
  1943.    dc.w   40
  1944.    dc.w   0
  1945.    dc.w   90
  1946.    dc.w   0
  1947.    dc.w   1
  1948.    dc.l   START
  1949.    dc.l   _Menu0Item
  1950.    ds.b   8
  1951.  
  1952.    dc.l   $0000
  1953.    dc.w   160
  1954.    dc.w   0
  1955.    dc.w   130
  1956.    dc.w   0
  1957.    dc.w   1
  1958.    dc.l   INFO
  1959.    dc.l   _Menu1Item
  1960.    ds.b   8
  1961.  
  1962. SC1  dc.b   'Players'
  1963. SC2:
  1964. SC9:
  1965. SC12:
  1966. SC20:
  1967. SC22:
  1968.      dc.b   0
  1969. SC3  dc.b   'Aces       ',0
  1970. SC4  dc.b   'Twos       ',0
  1971. SC5  dc.b   'Threes     ',0
  1972. SC6  dc.b   'Fours      ',0
  1973. SC7  dc.b   'Fives      ',0
  1974. SC8  dc.b   'Sixes      ',0
  1975. SC10 dc.b   'Upper Total',0
  1976. SC11 dc.b   'Bonus      ',0
  1977. SC13 dc.b   '3 of a Kind',0
  1978. SC14 dc.b   '4 of a Kind',0
  1979. SC15 dc.b   'Full House ',0
  1980. SC16 dc.b   'Sm Straight',0
  1981. SC17 dc.b   'Lg Straight',0
  1982. SC18 dc.b   'Yacht     ',0
  1983. SC19 dc.b   'Yarboro    ',0
  1984. SC21 dc.b   'Lower Total',0
  1985. SC23 dc.b   'Grand Total',0
  1986. SC24 dc.b   '  One   ',0
  1987. SC25 dc.b   '  Two   ',0
  1988. SC26 dc.b   ' Three  ',0
  1989. SC27 dc.b   '  Four  ',0
  1990.  
  1991. .4 dc.b  '                                             ',0
  1992.    dc.b  '                    YachtC                   ',0
  1993.    dc.b  '       Copyright 1985 by Sheldon Leemon      ',0
  1994.    dc.b  '                                             ',0
  1995.    dc.b  '  You may copy and distribute this program   ',0
  1996.    dc.b  '  freely (i.e. for no money), but any kind   ',0
  1997.    dc.b  '   of commercial exploitation is a no-no.    ',0
  1998.    dc.b  '  ****   Version 4.0  by Jeff Glatt   ****   ',0
  1999.    dc.b  '  Based on a version by Mark Schretlen with  ',0
  2000.    dc.b  '   "scales" sound sources by Steve Bennett.  ',0
  2001.    dc.b  '                                             ',0
  2002.  
  2003. .5 dc.b  '                                              ',0
  2004.    dc.b  '                 Instructions                 ',0
  2005.    dc.b  '                                              ',0
  2006.    dc.b  '  To start game, select 1-4 Player game from  ',0
  2007.    dc.b  '  the Project menu.  Each  player gets up to  ',0
  2008.    dc.b  '  3 rolls of the  dice to make the best hand  ',0
  2009.    dc.b  '  possible.  Click on the  dice you  wish to  ',0
  2010.    dc.b  '  change, then click on the button below the  ',0
  2011.    dc.b  '  dice to roll.  If you  are satisfied  with  ',0
  2012.    dc.b  '  your hand, and wish to score, click on the  ',0
  2013.    dc.b  '  button  without  blanking  any  dice.  All  ',0
  2014.    dc.b  '  possible scores will appear in  purple  on  ',0
  2015.    dc.b  '  the scorepad.  Click on the one you want.   ',0
  2016.    dc.b  '                                              ',0
  2017.  
  2018. .7 dc.b  ' Start 1-Player Game ',0
  2019.    dc.b  ' Start 2-Player Game ',0
  2020.    dc.b  ' Start 3-Player Game ',0
  2021.    dc.b  ' Start 4-Player Game ',0
  2022.  
  2023. INSTR dc.b  ' Instructions ',0
  2024. ABOUT dc.b  ' About YachtC ',0
  2025.   
  2026. START dc.b  ' Start ',0
  2027. INFO  dc.b  ' Information ',0
  2028.   
  2029. FontName      dc.b 'topaz.font',0
  2030. IntuitionName dc.b 'intuition.library',0
  2031. GfxName       dc.b 'graphics.library',0
  2032.  
  2033. NBTitle dc.b '                     YachtC (V4.0)               ',0
  2034. Spaces dc.b '                             ',0
  2035.  
  2036.    END
  2037.